package ua.epam.elective;

import human.User;

import java.sql.SQLException;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import jdbc.UserDao;

public class Main {
	private static final Logger log = Logger.getLogger(Main.class);
	
	
	public static void main(String[] args) {
		log.debug("Start processing\n");
		 
		Long l = null;
		String s = "-300";
	       
		class Test implements Runnable {
			public User user;

			@Override
			public void run() {

				UserDao userDao2 = new UserDao();
				userDao2.start();
				User[] users = new User[2];
				int i;
				for (i = 0; i < 2; i++) {
					users[i] = userDao2.selectUserById(1L);
				}
				userDao2.close();
				
				user = users[0];
				System.out.println(user.toString());
			}

		}
		User user = null;
		Test tests[] = new Test[10];
		int i = 0;
		for (Test t : tests) {

			t = new Test();
			Thread thread = new Thread(t);
			thread.start();
			if (i == 0) {
				i = 1;
				user = t.user;
			}
		}

	}
}
